<template>
  <div id="app" class="writehomework" v-if="homework.ID">
    <i-panel
      v-for="(itembank, i) in schoolhomeworkitembank"
      :key="i"
      header-class="writehomework-header"
      :title="'第'+(i+1)+'题'"
      :status="itembank.type"
      class="list"
      style="display: block; padding-bottom:15px;"
    >
      <div class="html" style="padding:15rpx; height:350px;">
        <div v-html="itembank.text"></div>
      </div>
      <div>
        <div>
          <div class="text-center" v-if="itembank.type === '单选'">
            <i-button
              :type="itembank.schoolstudenthomeworkitembank[0].data.answer === vo?'info': ''"
              :round="true"
              v-for="(vo, io) in itembank.data[itembank.type]"
              :key="io"
              v-text="vo"
              custom-class="school-button-round"
            ></i-button>
          </div>
          <div class="text-center" v-else-if="itembank.type === '多选'">
            <div>
              <i-button
                :type="itembank.schoolstudenthomeworkitembank[0].data.answer[vo]?'info': ''"
                :round="true"
                v-for="(vo, io) in itembank.data[itembank.type]"
                :key="io"
                v-text="vo"
                custom-class="school-button-round"
              ></i-button>
            </div>
          </div>
        </div>
        <div>
          <header style="padding:0px 20px;font-weight: 800;">我的答案</header>
          <div style="line-height: 26px;">
            <view v-if="itembank.type==='填空'" style="padding:10px 20px;">
              <span
                v-for="(vo, ins) in itembank.schoolstudenthomeworkitembank[0].data.answer"
                :key="ins"
              >{{ins+1}}.{{vo}}</span>
            </view>
            <view v-else-if="itembank.type==='多选'" style="padding:10px 20px;">
              <span
                v-for="(vo, ins) in itembank.schoolstudenthomeworkitembank[0].data.answer"
                :key="ins"
              >{{vo}}</span>
            </view>
            <view
              v-else
              style="padding:10px 20px;"
              v-text="itembank.schoolstudenthomeworkitembank[0].data.answer"
            ></view>
          </div>
        </div>
      </div>
    </i-panel>
  </div>
</template>

<script>
import a from './a'
export default a
</script>

